package com.atguigu.lease.common.exceptions;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;

@Data
public class LeaseException extends RuntimeException{
    private int code;//错误状态码

    public LeaseException(String message) {
        super(message);
    }
    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        code = resultCodeEnum.getCode();
    }

    public LeaseException(int code,String message) {
        super(message);
        this.code = code;
    }
}
